//
//  SQSpecialSingleTableViewCell.m
//  energy
//
//  Created by 周曼迪 on 2021/7/20.
//

#import "SQSpecialSingleTableViewCell.h"

#import "SQSpecialodel.h"

@implementation SQSpecialSingleTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}



+(CGFloat)cellHeight:(BaseModel *)model{
    return W(190);
}

-(void)setModel:(BaseModel<BaseCellModelProtocol> *)model{
    
    SQSpecialodelData * dataModel = model;

        self.lab_sa_inspection_frequency.text = @"单次检查";
    


    self.lab_sa_publisher_person_text.text = dataModel.sa_publisher_person_text;
    self.lab_sa_start.text = dataModel.sa_star;
    self.lab_sa_end.text = dataModel.sa_end;
    


    self.lab_sa_frequency_num.text = [NSString stringWithFormat:@"%@天一次",dataModel.sa_frequency_num];

    if ([dataModel.sir_state isEqualToString:@"0"]) {
        self.lab_type.text = @"未完成";
        self.lab_type.textColor = [UIColor colorNamed:@"ff00Color"];
        self.btn_details.hidden = NO;
        
    }else if ([dataModel.sir_state isEqualToString:@"1"]){//完成
        self.lab_type.text = @"已完成";
        self.lab_type.textColor = [UIColor colorNamed:@"19c8a8Color"];
        self.btn_details.hidden = YES;
    }
}

- (IBAction)clickWorkDetails:(UIButton *)sender {
    self.cellEvent((int)self.indexPath.row);
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
